package com.home.fansea.config;

import com.home.fansea.fliter.PictureFilter;
import com.home.fansea.fliter.RefreshInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {
 
    @Autowired
    private RefreshInterceptor refreshInterceptor;

    @Autowired
    private PictureFilter pictureFilter;

 
    @Override  
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(refreshInterceptor).addPathPatterns("/**").order(0);
        registry.addInterceptor(pictureFilter);
        // 你可以添加更多配置，比如拦截哪些路径，不拦截哪些路径等
    }  
}